<template>
    <view class="timeLimit">
        <view class="bidList_entire">
            <view class="bidList_images">
                <image src="{{detail.topicImage }}" mode="aspectFit" style="height: 200px"></image>
            </view>
            <view style="text-align: center;">{{detail.name}}</view>
            <view class="bidList_flex">
                <view class="bidList_flex1 backf5f5f9">
                    <text>卖家最低售价</text>
                    <view class="border-right" style="background: #fff"></view>
                </view>
                <view class="bidList_flex2 backf5f5f9">
                    <view class="bidList_pire">￥
                        <text>{{detail.minSellerOfferAmount}}</text>
                    </view>
                </view>
                <view class="bidList_flex3 backe6e6e6">
                    <text>买家最高出价</text>
                    <view class="border-right" style="background: #fff"></view>
                </view>
                <view class="bidList_flex4 backe6e6e6">
                    <view class="bidList_pire">￥
                        <text>{{detail.maxBuyerOfferAmount}}</text>
                    </view>
                </view>
            </view>

            <view class="bidList_flex_sta" style="margin-top: 20rpx;">
                <view class=" back_fff">
                    <text></text>
                </view>
                <view class=" back_fff">
                    <text>时效天数选择</text>
                </view>
                <view class=" back_fff icon">
                    <text @tap="urlTo">取消</text>
                </view>
            </view>
            <view class="weixinAndzhifubao">
                <view class="boxfix" wx:for="{{list}}" wx:key="item" @tap="chooseSx" data-ts="{{item}}">
                    <text>{{item}}天</text>
                    <view class="xuanze">
                        <i class="iconfont {{thisChoose == item ? 'icon-dui xuanze_color_dui' : 'icon-yuancircle46 xuanze_color_quan'}}"></i>
                    </view>
                </view>
            </view>
        </view>
    </view>

</template>
<script>
import wepy from 'wepy'
import api from '@/api/api'
import tip from '@/utils/tip'
import { GOODSDETAIL , TOPAYSXX } from '@/utils/constant'

export default class timeLimit extends wepy.page {
    config = {
        // 配置当前页面
        navigationBarTitleText: '时效性' // 头部标题
    }
    data = {
        detail:'',
        userId:'',
        list:[1,3,7,14,30,60],
        thisChoose : 30
    }
    methods = {
        urlTo() {
            wx.navigateBack();
        },
        chooseSx(e){
            const t = this;
            t.thisChoose = e.currentTarget.dataset.ts;
            wx.setStorageSync(TOPAYSXX, t.thisChoose);
            wx.navigateBack();
        }
    }
    onShow() {
        const t = this;
        let detail = wx.getStorageSync(GOODSDETAIL);
        let userId = wx.getStorageSync('userId');
        let sxx = wx.getStorageSync(TOPAYSXX);
        if (detail) {
            t.detail = detail;
            if (userId) {
                t.userId = userId;
            }
            if(sxx){
                t.thisChoose = sxx;
            }
        }
    }
}
</script>
<style lang="less">
.timeLimit {
    .pofix {
        position: fixed;
        bottom: 0;
        width: 100%;
        .btn_to {
            display: flex;
            > view {
                width: 50%;
                font-size: 36rpx;
                height: 95rpx;
                line-height: 95rpx;
                text-align: center;
            }
            > view:first-child {
                background: #ffb025;
                color: #fff;
            }
            > view:last-child {
                background: #fff;
                color: #333;
            }
        }
    }
    > view:first-child {
        margin-top: 0 !important;
    }
    > view {
        margin-top: 20rpx;
    }
    .bidList_entire {
        .bidList_images{
            text-align: center;
        }
        .backf5f5f9 {
            background: #FFA622;
            color: #fff;
        }
        .back_fff {
            background: #fff;
        }
        .backe6e6e6 {
            background: #70B957;
            color: #fff;
        }
        .color_org {
            color: #ffb025;
        }

        .bidList_flex_sta {
            display: flex;
            justify-content: flex-start;
            padding: 20rpx 0;
            background: #fff;
            > view:first-child {
                width: 33.3%;
                text-align: left;
            }
            > view:nth-child(2) {
                width: 33.3%;
                text-align: center;
            }
            > view:last-child {
                width: 33.3%;
                text-align: right;
                margin-left: auto;
                text {
                    padding-right: 20rpx;
                    color: #999 !important;
                }
            }
        }
        .bidList_flex {
            display: flex;
            justify-content: flex-start;
            .bidList_flex1 {
                width: 30%;
                overflow: hidden;
                padding: 20rpx 0;
                position: relative;
                text {
                    padding-left: 20rpx;
                }
                .border-right {
                    position: absolute;
                    top: 4rpx;
                    right: 0;
                    width: 2rpx;
                    height: 80rpx;
                }
            }
            .bidList_flex2 {
                width: 20%;
                text-align: right;
                padding: 20rpx 0;
                .bidList_pire {
                    font-size: 22rpx;
                    color: #fff;
                    text {
                        padding-right: 20rpx;
                        font-size: 30rpx;
                    }
                }
            }
            .bidList_flex3 {
                width: 30%;
                position: relative;
                padding: 20rpx 0;
                .modification {
                    text-align: right;
                    view:first-child {
                        width: 50rpx;
                        height: 50rpx;
                    }
                    view {
                        display: inline-block;
                        i {
                            vertical-align: middle;
                            font-size: 36rpx;
                            padding-right: 10rpx;
                        }
                        text {
                            padding-left: 0;
                            vertical-align: middle;
                            display: inline-block;
                        }
                    }
                }
                text {
                    padding-left: 20rpx;
                }
                .border-right {
                    position: absolute;
                    top: 4rpx;
                    right: 0;
                    width: 2rpx;
                    height: 80rpx;
                    color: #fff;
                }
            }
            .bidList_flex4 {
                width: 20%;
                text-align: center;
                padding: 20rpx 0;
                .bidList_pire {
                    font-size: 22rpx;
                    color: #fff;
                    text {
                        font-size: 30rpx;
                    }
                }
                .modification {
                    view:first-child {
                        width: 50rpx;
                        height: 50rpx;
                    }
                    view {
                        display: inline-block;
                        i {
                            vertical-align: middle;
                            font-size: 32rpx;
                            padding-right: 10rpx;
                        }
                        text {
                            padding-left: 0;
                            vertical-align: middle;
                            display: inline-block;
                        }
                    }
                }
            }
            .ineedBuy_chujia {
                background: #fff;
                display: flex;
                > text:first-child {
                    vertical-align: middle;
                    height: 100rpx;
                    line-height: 100rpx;
                    padding-left: 40rpx;
                    font-size: 22rpx;
                }
                > view {
                    vertical-align: middle;
                    padding: 20rpx 0;
                    padding-right: 15rpx;
                    input {
                        background: #e6e6e6;
                        border: 1px solid #999;
                        width: 320rpx;
                    }
                }
                > text:last-child {
                    vertical-align: middle;
                    width: 120rpx;
                    font-size: 22rpx;
                    padding: 10rpx 0;
                }
            }
        }
    }
    .weixinAndzhifubao {
        margin-top: ~'20rpx';
        background: #fff;
        border-bottom: 1px solid #ddd;
        border-top: 1px solid #ddd;
        .boxfix {
            height: ~'100rpx';
            line-height: ~'100rpx';
            padding-right: ~'30rpx';
            display: flex;

            .iconWis {
                text-align: center;
                width: ~'70rpx';
                .icon-weixinzhifu2 {
                    color: #3cb034;
                }
                .icon-zhifubao {
                    color: #108ee9;
                }
                i {
                    font-size: 20px;
                }
            }
            text {
                margin-right: auto;
            }
            .xuanze {
                .xuanze_color_quan {
                    color: #333;
                    font-size: 18px;
                }
                .xuanze_color_dui {
                    color: orange;
                }
            }
        }
        > view {
            border-bottom: 1px solid #ddd;
        }
        text {
            padding-left: ~'20rpx';
            font-size: ~'28rpx';
        }
    }
}
</style>
